﻿Imports System.Data
Imports VSModel
Imports Cls_Common

Partial Class Control_TinhTP_Detail
    Inherits System.Web.UI.UserControl
#Region "Sub and Function "
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If Not IsPostBack Then
            If Not Request.QueryString("TinhId").ToString.Equals("0") Then
                hidID.Value = Request.QueryString("TinhId")
                ShowData()
            End If
        End If
    End Sub
    Protected Sub ShowData()
        Using data As New VSEntities
            Dim p As DonViHanhChinh = (From q In data.DonViHanhChinhs Where q.Id = hidID.Value Select q).SingleOrDefault
            If Not p Is Nothing Then
                lblCode.Text = IIf(IsNothing(p.Code) = True, "", p.Code)
                lblTitle.Text = IIf(IsNothing(p.Title) = True, "", p.Title)

                lblDescription_detail.Text = IIf(IsNothing(p.Description) = True, "", p.Description)
            End If
        End Using
    End Sub
#End Region
End Class
